package com.exam.controller;

import com.exam.entity.ApiResult;
import com.exam.entity.FillQuestion;
import com.exam.serviceimpl.FillQuestionServiceImpl;
import com.exam.util.ApiResultHandler;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "填空题接口")
@RestController
public class FillQuestionController {

    @Resource
    private FillQuestionServiceImpl fillQuestionService;


    @ApiOperation(value = "添加填空题")
    @PostMapping("/fillQuestion")
    public ApiResult add(@RequestBody FillQuestion fillQuestion) {
        return fillQuestionService.add(fillQuestion);
    }

    @ApiOperation(value = "查询最后一条questionId")
    @GetMapping("/fillQuestionId")
    public ApiResult findOnlyQuestionId() {
        return fillQuestionService.findOnlyQuestionId();
}
}
